﻿using System;
using PPI.Client.Presenter;
using PPI.Client.Utils;
using PPI.Entities.Distribution;

namespace PPI
{
    public partial class frmSplashDistribution : frmBase, ISplashDistribution
    {
        private Int32 m_PoleId;
        private EDistributionPole m_Pole;
        private SplashDistributionPresenter m_Presenter;

        public frmSplashDistribution()
        {
            InitializeComponent();

            MenuMain.Visible = false;
            FormSize = FormSizes.Medium;
        }

        public string ActionMessage
        {
            set { lblToTellAction.Text = value;}
        }

        public int ActionProgress
        {
            set { pbAction.Value = value; }
        }

        public int InspectionId
        {
            get { return m_PoleId; }
            set { m_PoleId = value;  }
        }

        public EDistributionPole Pole
        {
            set { m_Pole = value; }
            get { return m_Pole; }
        }

        public void Finish()
        {
            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }

        private void frmSplashDistribution_Load(object sender, EventArgs e)
        {
            try
            {
                m_Presenter = new SplashDistributionPresenter(this);
            }
            catch (Exception ex)
            {
                RegisterError.SaveError(ex);
            }
        }
    }
}
